﻿using System;

namespace negoserverjni
{
    public class RequestState
    {
        bool firstRoundtrip = true;
        //State of the request BeginRead
        byte[] buf;
        int offset;
        int length;
        object state;
        AsyncCallback continuation;
        int sizeRequested;
        int status;

        public bool IsFirstRoundTrip
        { get { return firstRoundtrip; } set { firstRoundtrip = value; } }
        public byte[] Buffer
        { get { return buf; } }
        public int Offset
        { get { return offset; } }
        public int Length
        { get { return length; } }
        public object State
        { get { return state; } }
        public AsyncCallback Continuation
        { get { return continuation; } }
        public int SizeRequested
        { get { return sizeRequested; } set { sizeRequested = value; } }


        public void SaveState(byte[] buffer, int offset, int len, AsyncCallback callback, object state)
        {
            buf = buffer;
            this.offset = offset;
            length = len;
            continuation = callback;
            this.state = state;
        }
    }
}
